<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增创建申请单" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-sale-add"  class="form-horizontal">
    <h4 class="form-header h4"><@ctx.i18n text = "基本信息"/></h4>
    <input  type="hidden" name="userId" value="${user.id}">
    <input  type="hidden" name="userName" value="${user.name}">
    <input  type="hidden" name="modelKey" value="${bpmTaskFrom.modelKey}">
    <input  type="hidden" name="taskId" value="${bpmTaskFrom.id}">
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "表单类型"/>：
            </label>
                <div class="col-sm-8"><input name="fromName"  value="${bpmTaskFrom.fromName}" class="form-control" type="text"  readonly="true">
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "订单号"/>：
            </label>
                <div class="col-sm-8"><input name="saleCode"  value="${saleCode}" class="form-control" type="text"  readonly="true">
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>：
            </label>
                <div class="col-sm-8"><input name="salePerson"  value="${user.name}" class="form-control" type="text"  readonly="true">
                </div>
            </div>
<!--        </div>-->
<!--    </div>-->
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售组"/>：
            </label>
                <div class="col-sm-8"><input name="saleTeam" value="${user.compName}" class="form-control" type="text"  readonly="true">
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售经理"/>：
            </label>
                <div class="col-sm-8"><input name="saleManager" value="${user.compName}" class="form-control" type="text"  readonly="true">
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">
                <label class="col-sm-3 control-label"><@ctx.i18n text = "订单状态"/>：</label>
                <div class="col-sm-8">
                    <@form.select name="saleStatus" dictType="sys_sale_status"/>
                </div>
            </div>
<!--        </div>-->
<!--    </div>-->
    <h4 class="form-header h4"><@ctx.i18n text = "客户信息"/></h4>
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "选择线索"/>：
            </label>
                <div class="col-sm-8"> <button type="button" onclick="selectClues()" class="btn btn-success btn-sm"><i class="fa fa-cogs"></i> 选择线索</button>
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户名称"/>：
            </label>
                <div class="col-sm-8"><input name="saleCustomername" class="form-control" type="text"  required>
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户地址"/>：
            </label>
                <div class="col-sm-8"><input name="saleAddress" class="form-control" type="text"  required>
                </div>
            </div>
<!--        </div>-->

<!--    </div>-->
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户手机号"/>：
            </label>
                <div class="col-sm-8"><input name="salePhone" class="form-control" type="text"  required>
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户邮箱"/>：
            </label>
                <div class="col-sm-8"><input name="saleEmail" class="form-control" type="text"  required>
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户微信"/>：
            </label>
                <div class="col-sm-8"><input name="saleWechat" class="form-control" type="text"  required>
                </div>
            </div>
<!--        </div>-->
<!--    </div>-->
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "ID"/>：</label>
                <div class="col-sm-8">
                    <@form.radio name="saleId" dictType="sys_sale_id" />
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group jiazhao">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "驾照" />:
        </label>
        <div class="col-sm-8">
<!--            <input name="saleDriverlicense" class="form-control" type="text">            -->
<!--            <button type="button" class="btn btn-success btn-sm upload"><i-->
<!--                    class="fa fa-upload"></i> 上传驾照</button>-->
            <div class="layui-upload">
<!--                <button type="button" class=" layui-btn" id="choiceList"><i class="iconfont icon-e645"></i>选择多文件</button>-->
                            <button type="button" class="btn btn-success btn-sm" id="choiceList"><i class="fa fa-upload"></i> 上传驾照</button>
                         <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demoList">
                        <tr id="upload">
                        </tr>
                        </tbody>
                    </table>
                </div>
                         <div class="layui-form-item layui-btn-Center">
                             <div class="layui-input-block text-right">
                                <button type="button" class="layui-btn layui-btn-xs" id="choiceListAction">开始上传</button>
<!--                                <button class="btn layui-btn layui-btn-xs layui-btn-primary js_close" id="quXiao" type="button">取消</button>-->
                             </div>
                         </div>
<!--                <button type="button" class="layui-btn layui-btn-xs" id="choiceListAction">开始上传</button>-->
<!--                <button class="btn layui-btn layui-btn-xs layui-btn-primary js_close" id="quXiao" type="button">取消</button>-->

            </div>
        </div>
    </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group huzhao">
                <label class="col-sm-3 control-label"><@ctx.i18n text = "护照" />:
                </label>
                <div class="col-sm-8">
                    <div class="layui-upload">
                        <button type="button" class="btn btn-success btn-sm" id="huzhaoList"><i class="fa fa-upload"></i> 上传护照</button>
                        <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                            <table class="layui-table">
                                <thead>
                                <tr>
                                    <th>文件名</th>
                                    <th>大小</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody id="demohuzhaoList">
                                <tr id="uphuzhaoload">
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-form-item layui-btn-Center">
                            <div class="layui-input-block text-right">
                                <button type="button" class="layui-btn layui-btn-xs" id="huzhaoListAction">开始上传</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
<!--        </div>-->


<!--    </div>-->
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
<!--            <div class="form-group">-->
<!--&lt;!&ndash;                <label class="col-sm-5 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "ID"/>：</label>&ndash;&gt;-->
<!--&lt;!&ndash;                <div class="col-sm-7">&ndash;&gt;-->
<!--&lt;!&ndash;                    <@form.radio name="saleId" dictType="sys_sale_id" />&ndash;&gt;-->
<!--&lt;!&ndash;                </div>&ndash;&gt;-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="col-sm-8">-->
<!--         <div class="form-group huzhao">-->
<!--        <label class="col-sm-3 control-label"><@ctx.i18n text = "护照" />:-->
<!--        </label>-->
<!--            <div class="col-sm-8">-->
<!--                <div class="layui-upload">-->
<!--                    <button type="button" class="btn btn-success btn-sm" id="huzhaoList"><i class="fa fa-upload"></i> 上传护照</button>-->
<!--                    <div class="layui-upload-list layui-upList-minHeight uploadpadding">-->
<!--                        <table class="layui-table">-->
<!--                            <thead>-->
<!--                            <tr>-->
<!--                                <th>文件名</th>-->
<!--                                <th>大小</th>-->
<!--                                <th>状态</th>-->
<!--                                <th>操作</th>-->
<!--                            </tr>-->
<!--                            </thead>-->
<!--                            <tbody id="demohuzhaoList">-->
<!--                            <tr id="uphuzhaoload">-->
<!--                            </tr>-->
<!--                            </tbody>-->
<!--                        </table>-->
<!--                    </div>-->
<!--                    <div class="layui-form-item layui-btn-Center">-->
<!--                        <div class="layui-input-block text-right">-->
<!--                            <button type="button" class="layui-btn layui-btn-xs" id="huzhaoListAction">开始上传</button>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--    </div>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="row">-->
<!--        <div class="col-sm-4">-->
            <div class="form-group">
                <label class="col-sm-3 control-label"><@ctx.i18n text = "房产"/>：</label>
                <div class="col-sm-8">
                      <@form.radio name="saleResidenceinfo" dictType="sys_sale_resi" />
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
            <div class="form-group ssn">        <label class="col-sm-3 control-label"><@ctx.i18n text = "SSN"/>：
                 </label>
                <div class="col-sm-8"><input name="orderCustomerSsn" class="form-control" type="text" >
                </div>
            </div>
<!--        </div>-->
<!--        <div class="col-sm-4">-->
                <div class="form-group i20">        <label class="col-sm-3 control-label"><@ctx.i18n text = "I-20"/>：
                </label>
                    <div class="col-sm-8">
                        <!--                <input name="orderCustomerIFilepath" class="form-control" type="text" >-->
                        <div class="layui-upload">
                            <!--                <button type="button" class=" layui-btn" id="choiceList"><i class="iconfont icon-e645"></i>选择多文件</button>-->
                            <button type="button" class="btn btn-success btn-sm" id="i20List"><i class="fa fa-upload"></i> 上传I-20</button>
                            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                                <table class="layui-table">
                                    <thead>
                                    <tr>
                                        <th>文件名</th>
                                        <th>大小</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="demoi20List">
                                    <tr id="upi20load">
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="layui-form-item layui-btn-Center">
                                <div class="layui-input-block text-right">
                                    <button type="button" class="layui-btn layui-btn-xs" id="i20ListAction">开始上传</button>
                                    <!--                            <button class="btn layui-btn layui-btn-xs layui-btn-primary js_close" id="huzhaoXiao" type="button">取消</button>-->
                                </div>
                            </div>
                            <!--            <button type="button" class="btn btn-success btn-sm upload"><i-->
                            <!--                    class="fa fa-upload"></i> 上传护照</button>-->
                        </div>
                    </div>
                </div>
<!--        </div>-->
<!--    </div>-->

<!--    <div class="row">-->
<!--        <div class="col-sm-12">-->
        <div class="form-group">
            <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control"></textarea>
            </div>
        </div>
<!--        </div>-->
<!--    </div>-->
<!-- -->
<!--        <h4 class="form-header h4"><@ctx.i18n text = "合同信息"/></h4>-->
<!--        <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "合同价格"/>：-->
<!--        </label>-->
<!--            <div class="col-sm-8"><input name="orderContractPrice"  class="form-control" type="number" >-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label"><@ctx.i18n text = "是否包含税"/>：</label>-->
<!--            <div class="col-sm-8">-->
<!--                  <@form.radio name="orderIsTax" dictType="sys_yes_no" />-->
<!--&lt;!&ndash;                <#list dict.getType('sys_crm_yesno')>&ndash;&gt;-->
<!--&lt;!&ndash;                <#items as d>&ndash;&gt;-->
<!--&lt;!&ndash;                <div class="radio-box">&ndash;&gt;-->
<!--&lt;!&ndash;                    <input type="radio" id="orderIsTax" name="orderIsTax" value="${d.dictValue}"&ndash;&gt;-->
<!--&lt;!&ndash;                    <#if d.dictValue == '0'?default("") >checked</#if> />&ndash;&gt;-->
<!--&lt;!&ndash;                <label for="${(d.id)?default('')}">${d.dictLabel}</label>&ndash;&gt;-->
<!--&lt;!&ndash;            </div>&ndash;&gt;-->
<!--&lt;!&ndash;        </#items>&ndash;&gt;-->
<!--&lt;!&ndash;    </#list>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否包含运输费"/>：</label>-->
<!--    <div class="col-sm-8">-->
<!--          <@form.radio name="orderIsTransportFee" dictType="sys_yes_no" />-->
<!--&lt;!&ndash;        <#list dict.getType('sys_crm_yesno')>&ndash;&gt;-->
<!--&lt;!&ndash;        <#items as d>&ndash;&gt;-->
<!--&lt;!&ndash;        <div class="radio-box">&ndash;&gt;-->
<!--&lt;!&ndash;            <input type="radio" id="orderIsTransportFee" name="orderIsTransportFee" value="${d.dictValue}"&ndash;&gt;-->
<!--&lt;!&ndash;            <#if d.dictValue == '0'?default("") >checked</#if> />&ndash;&gt;-->
<!--&lt;!&ndash;        <label for="${(d.id)?default('')}">${d.dictLabel}</label>&ndash;&gt;-->
<!--&lt;!&ndash;    </div>&ndash;&gt;-->
<!--&lt;!&ndash;</#items>&ndash;&gt;-->
<!--&lt;!&ndash;</#list>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否保修"/>：</label>-->
<!--    <div class="col-sm-8">-->
<!--          <@form.radio name="orderIsWarranty" dictType="sys_yes_no"/>-->
<!--&lt;!&ndash;        <#list dict.getType('sys_crm_yesno')>&ndash;&gt;-->
<!--&lt;!&ndash;        <#items as d>&ndash;&gt;-->
<!--&lt;!&ndash;        <div class="radio-box">&ndash;&gt;-->
<!--&lt;!&ndash;            <input type="radio" id="orderIsWarranty" name="orderIsWarranty" value="${d.dictValue}"&ndash;&gt;-->
<!--&lt;!&ndash;            <#if d.dictValue == '0'?default("") >checked</#if> />&ndash;&gt;-->
<!--&lt;!&ndash;        <label for="${(d.id)?default('')}">${d.dictLabel}</label>&ndash;&gt;-->
<!--&lt;!&ndash;    </div>&ndash;&gt;-->
<!--&lt;!&ndash;</#items>&ndash;&gt;-->
<!--&lt;!&ndash;</#list>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "其他"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderOtherItem" class="form-control" type="text" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆识别码"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderCarVin" class="form-control" type="text" maxlength="17" minlength="17">-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车型"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderCarVehicle"  class="form-control" type="text" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆ID"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderCarIdentity" class="form-control" type="text" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--    <label class="col-sm-3 control-label"><@ctx.i18n text = "合同生效日期"/>：</label>-->
<!--    <div class="col-sm-8">-->
<!--        <div class="input-group date">-->
<!--            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--            <input class="form-control time-input" name="orderEffectTime"  data-type="date"   data-format="yyyy-MM-dd" type="text" />-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "描述"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderContractpriceRemark"  class="form-control" type="text" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderContractpriceMoney" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收总和"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderReceivableMoney" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<h4 class="form-header h4"><@ctx.i18n text = "信用卡信息"/></h4>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "实收总和"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderFactMoney" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "期望价格/额度"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderHopePrice" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收余额"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="orderReceivablePrice" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<h4 class="form-header h4"><@ctx.i18n text = "业务成本信息"/></h4>-->
<!--<h5 class="form-header h5"><@ctx.i18n text = "业务成本汇总信息"/></h5>-->
<!--<div class="form-group">-->
<!--    <label class="col-sm-3 control-label"><@ctx.i18n text = "类别"/>：</label>-->
<!--    <div class="col-sm-8">-->
<!--        <input name="costType" class="form-control" type="text" >-->
<!--        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 总额,库存,运输,维修,临牌,过户,报销,汇款,整备,退车,其他</span>-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="costMoney"  class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<h5 class="form-header h5"><@ctx.i18n text = "业务流程汇总信息"/></h5>-->
<!--<div class="form-group">-->
<!--    <label class="col-sm-3 control-label"><@ctx.i18n text = "流程类型"/>：</label>-->
<!--    <div class="col-sm-8">-->
<!--        <input name="processType" class="form-control" type="text" >-->
<!--        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 总额,库存,运输,维修,临牌,过户,报销,汇款,整备,退车,其他</span>-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流程条数"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="processNumber" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流程进度"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="processProgress" class="form-control" type="text" >-->
<!--    </div>-->
<!--</div>-->
<!--<h4 class="form-header h4"><@ctx.i18n text = "预览提成"/></h4>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收（实收）总和"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewReceivableSum" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "目前成本"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewCurrentCost" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）利润"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewHopeProfit" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）业绩"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewHopeAchievement" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "提成比例"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewPercentage" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
<!--<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）提成"/>：-->
<!--</label>-->
<!--    <div class="col-sm-8"><input name="previewCommission" class="form-control" type="number" >-->
<!--    </div>-->
<!--</div>-->
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bpm/sale"
    $("#form-sale-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/add", $('#form-sale-add').serialize());
            // opt.operate.save(baseURL  +"bpm/task/complete", $('#form-sale-edit').serialize());
        }
    }

    /**
     * 选择线索
     **/
    function selectClues(){
        opt.modal.open('<i class="fa icon-note"></i> <@ctx.i18n text = "选择线索"/>',
            baseURL  +"bpm/Clue","1600","",SelectSub,true);
    }

    function SelectSub(e,layero){
        console.log(layero);
        var config = {
            url: baseURL + "bpm/Clue/sing",
            type: "POST",
            dataType: "JSON",
            data: {"id":layero.ids[0]},
            beforeSend: function () {
                $(window).block({ message: '<div class="loaderbox"><div class="loading-activity"></div> ' +
                        '<@ctx.i18n text = "数据正在认证,请稍后..."/>' + '</div>' });
            },
            success: function(result) {
                console.log(result)
                $(window).unblock();
                //客户名称
                $("input[name=saleCustomername]").val(result.customerName)
                $("input[name=saleAddress]").val(result.customerAddress)
                $("input[name=salePhone]").val(result.contactInfo)
            },
            error:function(){
                $(window).unblock();
                return;
            }
        };
        opt.selfLayer.close(e);
        $.ajax(config);
    }

    //在插件中使用对象
    $.fn.upfile = function(type) {
        var upfile = new Upfile(this,'',$("input[name='saleCode']").val(),type);

        layui.use('upload', function() {
            var upload = layui.upload;
            var UplodeIn = upload.render(upfile.options);
            upfile.SetInst(UplodeIn)

        });

    };
    /**
     * 驾照
     */
    $("#choiceList").upfile(1);
    /**
     * 护照
     */
    $('#huzhaoList').upfile(2);
    /**
     * I-20
     */
    $('#i20List').upfile(3);
    function redioCallback(id,data,event){
        /**
         * ID
         */
        if(id=="saleId"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                $(".huzhao").hide();
                $(".jiazhao").hide();
                if(menuType=="3"){
                    $(".huzhao").show();
                    $(".jiazhao").show();
                    return
                }
                if(menuType=="1"){
                    $(".huzhao").show();
                    return
                }
                if(menuType=="2"){
                    $(".jiazhao").show();
                    return
                }
            }
        }
        /**
         * 房产
         */
        if(id=="saleResidenceinfo"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                $(".ssn").hide();
                $(".i20").hide();
                if(menuType=="3"){
                    $(".ssn").show();
                    $(".i20").show();
                    return
                }
                if(menuType=="1"){
                    $(".ssn").show();
                    return
                }
                if(menuType=="2"){
                    $(".i20").show();
                    return
                }
            }
        }
    }
</script>

</@footer>
</@pageTheme>
<!--multiple="multiple"-->